function t(t, i, a) {
    return i in t ? Object.defineProperty(t, i, {
        value: a,
        enumerable: !0,
        configurable: !0,
        writable: !0
    }) : t[i] = a, t;
}

var i = getApp(), a = require("../../api.js"), n = require("../../config.js");

Page({
    data: {
        user: {},
        actions: n.extract,
        cancelText: "取消",
        balance: 0,
        distribution: 2
    },
    onLoad: function(t) {},
    getData: function() {
        var t = this;
        i.request({
            url: a.distribution.index,
            method: "post",
            data: {},
            success: function(i) {
                console.log(i), console.log(i.data), 1 == i.code ? t.setData({
                    user: i.data,
                    balance: i.data.user.commission
                }) : wx.showToast({
                    title: i.msg,
                    icon: "none",
                    duration: 2e3
                });
            }
        });
    },
    distributionorders: function() {
        wx.navigateTo({
            url: "../distributionOrders/distributionOrders"
        });
    },
    distributionwithdrawal: function(t) {
        wx.navigateTo({
            url: "../distributionFunds/distributionFunds?payment=" + t.currentTarget.dataset.id + "&type=1"
        });
    },
    myteam: function() {
        wx.navigateTo({
            url: "../distributionTeam/distributionTeam"
        });
    },
    qrcode: function() {
        wx.navigateTo({
            url: "../distributionCode/distributionCode"
        });
    },
    openActionsheet: function() {
        this.setData({
            show: !0
        });
    },
    closeActionSheet: function() {
        this.setData({
            show: !1
        });
    },
    clickAction: function(i) {
        var a, n = this, e = i.detail, o = this;
        o.setData({
            page: 1
        });
        var s = e.index;
        switch (this.setData((a = {}, t(a, "actions[" + s + "].loading", !0), t(a, "actionType", s), 
        a)), s) {
          case 0:
            wx.navigateTo({
                url: "/pages/driver/withdraw-money/index?type=1&&yue=" + o.data.balance + "&&distribution=" + o.data.distribution
            });
            break;

          case 1:
            wx.navigateTo({
                url: "/pages/driver/withdraw-ali/index?type=2&&yue=" + o.data.balance + "&&distribution=" + o.data.distribution
            });
            break;

          case 2:
            wx.navigateTo({
                url: "/pages/driver/withdraw-wechat/index?type=0&&yue=" + o.data.balance + "&&distribution=" + o.data.distribution
            });
        }
        setTimeout(function() {
            var i;
            n.setData((i = {}, t(i, "show", !1), t(i, "actions[" + s + "].loading", !1), i));
        }, 100);
    },
    onReady: function() {},
    onShow: function() {
        this.getData();
    },
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {},
    onShareAppMessage: function() {}
});